import request from '@/utils/request'

// 查询水表设备配置列表
export function getMeterList(params) {
  return request({
    url: '/iot/backend/meter/config/list',
    method: 'get',
    params
  })
}

// 获取水表设备配置详细信息
export function getMeterDetail(meterId) {
  return request({
    url: `/iot/backend/meter/config/${meterId}`,
    method: 'get'
  })
}

// 新增水表设备配置
export function addMeter(data) {
  return request({
    url: '/iot/backend/meter/config',
    method: 'post',
    data
  })
}

// 修改水表设备配置
export function updateMeter(data) {
  return request({
    url: '/iot/backend/meter/config',
    method: 'put',
    data
  })
}

// 删除水表设备配置
export function deleteMeter(meterId) {
  return request({
    url: `/iot/backend/meter/config/${meterId}`,
    method: 'delete'
  })
}

///backend/meter/config/deviceTemplateList 获取设备模板
export function getIotDeviceTemplateList() {
  return request({
    url: '/iot/backend/meter/config/deviceTemplateList',
    method: 'get',
  })
}